
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

PROJECT(testngpp)

INCLUDE(ProjectVar.txt)

FIND_LIBRARY(DL_LIBRARY NAMES dl)
IF(DL_LIBRARY)
  SET(TESTNGPP_USE_DLOPEN TRUE)
ELSE(DL_LIBRARY)
  SET(TESTNGPP_USE_DLOPEN FALSE)
ENDIF(DL_LIBRARY)

FIND_LIBRARY(LTDL_LIBRARY NAMES ltdl)
IF(LTDL_LIBRARY)
  SET(TESTNGPP_USE_LTDL TRUE)
ELSE(LTDL_LIBRARY)
  SET(TESTNGPP_USE_LTDL FALSE)
ENDIF(LTDL_LIBRARY)

IF(MSVC)
  SET(TESTNGPP_USE_LOADLIBRARY TRUE)
ELSE(MSVC)
  SET(TESTNGPP_USE_LOADLIBRARY FALSE)
ENDIF(MSVC)

ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(src/utils)
ADD_SUBDIRECTORY(src/except)
ADD_SUBDIRECTORY(src/mem_checker)
ADD_SUBDIRECTORY(src/listeners)
ADD_SUBDIRECTORY(src/runner)
ADD_SUBDIRECTORY(scripts)
ADD_SUBDIRECTORY(samples)

########################################################
INSTALL(DIRECTORY include/testngpp DESTINATION include
          PATTERN ".svn" EXCLUDE
          PATTERN "comm" EXCLUDE
          PATTERN "runner" EXCLUDE
          PATTERN "win32" EXCLUDE)
		  
INSTALL(FILES include/testngpp/runner/loaders/ModuleLoader.h 
		  DESTINATION include/testngpp/runner/loaders)
		  
INSTALL(DIRECTORY 3rdparty/mem_checker DESTINATION 3rdparty
          PATTERN ".svn" EXCLUDE)		  
		  
#IF(MSVC)
INSTALL(DIRECTORY 3rdparty/boost DESTINATION 3rdparty
          PATTERN ".svn" EXCLUDE)
   
#ENDIF(MSVC)
		  
IF(USING_AS_TESTCPP)
  INSTALL(DIRECTORY include/testcpp DESTINATION include
          PATTERN ".svn" EXCLUDE)
ENDIF(USING_AS_TESTCPP)

IF(USING_AS_CXXTEST)
  INSTALL(DIRECTORY include/cxxtest DESTINATION include
          PATTERN ".svn" EXCLUDE)
ENDIF(USING_AS_CXXTEST)

